Cognitoware.Robotics.dll
Class DelegateDistribution<T>
T: The type of the values predicted by the distribution.
Summary
Creates a random distribution with values generated from a function delegate.
Constructor Summary
Creates a distribution using the delegate parameter.
Method Summary
AliasAs()
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
Equals(Object)
Inherited from System.Object
Finalize()
Inherited from System.Object
GetEntropy(IEnumerable<T>)
Inherited from Cognitoware.Mathematics.Probability.RandomDistribution
GetHashCode()
Inherited from System.Object
GetType()
Inherited from System.Object
MemberwiseClone()
Inherited from System.Object
Returns the probability of a specific value of T.
Not implemented in DelegateDistribution.
ToString()
Inherited from System.Object
Details
Creates a random distribution with values generated from a function delegate.
The delegate can be any function that takes a single T as a parameter and returns a double.
The user is responsible for making sure the values returned by the delegate are normalized.
Constructor Details
public DelegateDistribution(UnaryFn<Double> pdf)
Creates a distribution using the delegate parameter.
The delegate can be any function that takes a single T as a parameter and returns a double.
The user is responsible for making sure the values returned by the delegate are normalized.
Parameters:
pdf
-
The delegate function used to generate probability values.
Method Details
public override Double ProbabilityOf(T t)
Returns the probability of a specific value of T.
This is implements the abstract function in RandomDistribution.
Parameters:
t
-
The value in T whose probability is returned.
Returns:
The probability of t in the distribution.
public override T Sample(Random select)
Delegates do not allow reverse mappings. To sample a value, the user
should randomly select many values of T and use the probabilities of
those values to perform a Monte Carlo selection.
This implementation throws NotImplementedException.